
//违规事件-----》慢性疾病
function loadDetail2_mxjb(param, disTab) {
    if (param.MedId == 1) {
        param.ybType = "省医保"
    } else if (param.MedId == 2) {
        param.ybType = "市医保"
    }
    showDetail();
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.patname + "<span>违规&nbsp;&nbsp;&nbsp;" +  param.count+ "&nbsp;&nbsp;&nbsp;次</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">诊断名称：' + param.csickname + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;就诊号：'+param.no_treatlist+'</div>');
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">医生信息：'+param.staffname+'</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + param.dstartdate + "</h3>");
    $(".detailWindow .tableGroups").remove("");

    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    var url = "/quality/chronic/queryDetailList/" + param.inpcode;
    var groupDrg = getGroupObj("违规信息");
    tableGroup1.append(groupDrg);
        loadServerData(url, null, function (data) {
                var tr = $("<tr style='font-weight:bolder'></tr>");
                groupDrg.find("table").append(tr);
                tr.append($("<td>诊断名称</td>"));
                tr.append($("<td>药物名称</td>"));
                tr.append($("<td>规则描述</td>"));
                tr.append($("<td>时间</td>"));
                tr.append($("<td>金额</td>"));

                    for (var i = 0; i < data.datas.length; i++) {
                            var tr = $("<tr></tr>");
                            groupDrg.find("table").append(tr);
                            for (var j = 0; j < 1; j++) {
                                    if (i < data.datas.length) {
                                        tr.append($("<td>" + (data.datas[i].csickname) + "</td>"));
                                        tr.append($("<td>" + (data.datas[i].cdrugname) + "</td>"));
                                        tr.append($("<td>" + (data.datas[i].ruletext) + "</td>"));
                                        tr.append($("<td>" + (data.datas[i].intime) + "</td>"));
                                        tr.append($("<td>" + (data.datas[i].nmoney) + "</td>"));
                                        i++;
                                    } else {
                                        break;
                                    }
                            }
                    }
           // resizeDetail();
        })



};



function loadDetail2_dbz(param) {
    showDetail();
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.patname + "<span>违规&nbsp;&nbsp;&nbsp;" +  param.count+ "&nbsp;&nbsp;&nbsp;次</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室：' + param.deptname + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;就诊号：'+param.no_treatlist+'</div>');
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">医生信息：'+param.staffname+'</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + (param.deptname || "") + "</h3>");
    $(".detailWindow .tableGroups").remove("");
    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    //违规事件------》单病种
    var url = "/quality/drgs/queryDetailList/" + param.no_treatlist;
    var groupDrg = getGroupObj("违规信息");
    tableGroup1.append(groupDrg);
    loadServerData(url, null, function (data) {

        var tr = $("<tr style='font-weight:bolder'></tr>");
        groupDrg.find("table").append(tr);
        tr.append($("<td>当前总金额</td>"));
        tr.append($("<td>总金额定额</td>"));
        tr.append($("<td>费用分类名称</td>"));
        tr.append($("<td>时间</td>"));
        tr.append($("<td>响应结果</td>"));

        for (var i = 0; i < data.datas.length;) {
            var tr = $("<tr></tr>");
            groupDrg.find("table").append(tr);
            for (var j = 0; j < 1; j++) {
                if (i < data.datas.length) {
                    tr.append($("<td>" + (data.datas[i].nmoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].nfixedmoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].fareclassname) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].intime) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].response) + "</td>"));
                    i++;
                } else {
                    break;
                }
            }
        }
    })
}
//违规事件------》用药
function loadDetail2_yy(param) {
    showDetail();
    if (param.MictypeId == 1) {
        param.ybType = "省医保"
    } else if (param.MictypeId == 2) {
        param.ybType = "市医保"
    } else {
        param.ybType = param.MictypeId
    }
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.patname + "<span>违规&nbsp;&nbsp;&nbsp;" +  param.count+ "&nbsp;&nbsp;&nbsp;次</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室：' + param.deptname + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;就诊号：'+param.no_treatlist+'</div>');
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">医生信息：'+param.staffname+'</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + param.dstartdate + "</h3>");
    $(".detailWindow .tableGroups").remove("");
    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    var url = "/quality/normal/queryDetailList/" + param.inpcode;
    var groupDrg = getGroupObj("限制规则");
    tableGroup1.append(groupDrg);
    loadServerData(url, null, function (data) {
        var tr = $("<tr style='font-weight:bolder'></tr>");
        groupDrg.find("table").append(tr);
        tr.append($("<td>诊断名称</td>"));
        tr.append($("<td>药物名称</td>"));
        tr.append($("<td>规则描述</td>"));
        tr.append($("<td>时间</td>"));
        tr.append($("<td>响应结果</td>"));
        for (var i = 0; i < data.datas.length;) {
            var tr = $("<tr></tr>");
            groupDrg.find("table").append(tr);
            for (var j = 0; j < 1; j++) {
                if (i < data.datas.length) {
                    tr.append($("<td>" + (data.datas[i].csickname) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].drugidlist) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].ruletext) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].intime) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].response) + "</td>"));
                    i++;
                } else {
                    break;
                }
            }
        }
    })
}



//违规事件------》贫困就诊人
function loadDetail2_pk(param) {
    showDetail();
    if (param.MictypeId == 1) {
        param.ybType = "省医保"
    } else if (param.MictypeId == 2) {
        param.ybType = "市医保"
    } else {
        param.ybType = param.MictypeId
    }
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.patname + "<span>违规&nbsp;&nbsp;&nbsp;" +  param.count+ "&nbsp;&nbsp;&nbsp;次</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室：' + param.deptname + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;就诊号：'+param.inpcode+'</div>');
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">医生信息：'+param.staffname+'</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + param.dstartdate + "</h3>");
    $(".detailWindow .tableGroups").remove("");
    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    var url ="/quality/poor/queryMoneyDetailList/" + param.inpcode;
    var groupDrg = getGroupObj("限制规则");
    tableGroup1.append(groupDrg);
    loadServerData(url, null, function (data) {
        var tr = $("<tr style='font-weight:bolder'></tr>");
        groupDrg.find("table").append(tr);
        tr.append($("<td>就诊人性质</td>"));
        tr.append($("<td>不知道这是什么</td>"));
        tr.append($("<td>总费用</td>"));
        tr.append($("<td>丙类费用</td>"));
        tr.append($("<td>时间</td>"));
        for (var i = 0; i < data.datas.length;) {
            var tr = $("<tr></tr>");
            groupDrg.find("table").append(tr);
            for (var j = 0; j < 1; j++) {
                if (i < data.datas.length) {
                    tr.append($("<td>" + (data.datas[i].Icd10Name) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].Blbl) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].InMoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].blmoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].dinhos) + "</td>"));
                    i++;
                } else {
                    break;
                }
            }
        }
    })
}

function loadDetail2_rjss(param) {
    showDetail();
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.Mictypename + "<span>" + param.ybType + "</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">主要治疗方式：</div>');
    $(".detailWindow .ruleInfo").append('<div class="ruleContent">' + (param.opname || "") + '</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + (param.dstartdate || "") + "</h3>");
    $(".detailWindow .tableGroups").remove("");
    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    //疾病
    var url = "/standard/dayoperationRule/queryDetailList/" + param.Dayoperationid + "/Drg";
    var groupDrg = getGroupObj("适用疾病");
    tableGroup1.append(groupDrg);
    loadServerData(url, null, function (data) {
        for (var i = 0; i < data.datas.length;) {
            var tr = $("<tr></tr>");
            groupDrg.find("table").append(tr);
            for (var j = 0; j < 3; j++) {
                if (i < data.datas.length) {
                    tr.append($("<td>" + data.datas[i].Icdname + "【" + data.datas[i].Icdcode + "】</td>"));
                    i++;
                } else {
                    break;
                }
            }
        }
    })
}
